package com.xiaoxiang.gateway.config;

import org.springframework.cloud.client.loadbalancer.reactive.ReactorLoadBalancerExchangeFilterFunction;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

import javax.annotation.Resource;

/**
 * @author: haha
 * @date: 2022/3/31 18:57
 */
@Configuration
public class WebFluxFeignConfig {

    @Resource
    private ReactorLoadBalancerExchangeFilterFunction lbFunction;

    @Bean
    public WebClient getWebClient() {
        return WebClient.builder().filter(lbFunction).build();
    }
}
